package com.test.service;

import com.myspring.*;

@Component("userService")
@Scope("prototype")//作用域
public class UserServiceImpl implements BeanNameAware, InitializingBean, UserService {
    @Autowired
    private OrderService orderService;

    private String beanName;

    private String name;
    @Override
    public void setBeanName(String name) {
        beanName=name;
    }

    @Override
    public void afterPropertiesSet() {
        System.out.println("初始化操作");
    }

    public OrderService getOrderService() {
        return orderService;
    }

    public void setOrderService(OrderService orderService) {
        this.orderService = orderService;
    }

    public String getBeanName() {
        return beanName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public void test() {
        System.out.println("你好");
    }
}
